package com.jiuhao.controller;


import cn.hutool.json.JSONObject;
import com.jiuhao.dto.DocumentInfoDto;
import com.jiuhao.dto.SegmentsDto;
import com.jiuhao.service.BaiduService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

@RequiredArgsConstructor
@RestController
@RequestMapping("api")
public class BaiduController {

    private final BaiduService baiduService;

    /*@GetMapping("/document/{documentId}")
    public DocumentInfoDto getDocument(@PathVariable String documentId) {
        return baiduService.getDocumentDetail(documentId);
    }

    @GetMapping("/segments/{documentId}")
    public SegmentsDto getSegments(@PathVariable String documentId) {
        return baiduService.getDocumentSegments(documentId);
    }*/


    @GetMapping("/docEs/{documentId}")
    public Map<String,Object> getDocEs(@PathVariable String documentId) {
        return baiduService.getDocEs(documentId);
    }
}